import request from '../utils/request';
import { PAGE_SIZE } from '../constants';

export function fetch({ page }) {
	console.log('api/user/test3/'+page+'/10');
  return request('api/user/test3/'+page+'/10',{
    method: 'POST',
   	headers: { 'Accept': 'application/json', 'Content-Type': 'application/json'}
  });
}

export function create(values) {
  return request('/api/user/create', {
    method: 'POST',
   	headers: { 'Accept': 'application/json', 'Content-Type': 'application/json'},
    body: JSON.stringify(values),
  });
}

export function patch(id,values) {
  return request('/api/user/patch/'+id, {
    method: 'PATCH',
   	headers: { 'Accept': 'application/json', 'Content-Type': 'application/json'},
    body: JSON.stringify(values),
  });
}

export function remove(id) {
  return request('/api/user/remove/'+id.id, {
    method: 'DELETE'
  });
}

export function login(values) {
  return request('/api/user/login/', {
    method: 'POST',
    headers: { 'Accept': 'application/json', 'Content-Type': 'application/json'},
    body: JSON.stringify(values),
  });
}

export function register(values) {
  return request('/api/user/register/', {
    method: 'POST',
    headers: { 'Accept': 'application/json', 'Content-Type': 'application/json'},
    body: JSON.stringify(values),
  });
}